<template>
  <div>
    <tb-report
      :schemas="schemas"
      :columns="columns"
      :apiUrl="apiUrl"
      :tableData="tableData"
      :getData="getData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmPurchaseContractTrackingExport/list",
      schemas: [
        {
          label: "项目编号",
          field: "programNumber",
          component: "Input",
          placeholder: "项目编号",
          required: false,
          colProps: {},
        },
        {
          label: "报关金额",
          field: "foreignTradeAmount",
          component: "Input",
          placeholder: "报关金额",
          required: false,
          colProps: {},
        },
      ],
      columns: [
      { type: 'seq', key: 'seq', width: 50, title: '序号', fixed: 'left', treeNode: true, align: 'center' },

{ title: '项目编号', field: 'programNumber', key: 'programNumber', width: 120, align: 'center' },
{ title: '项目名称', field: 'programName', key: 'programName', width: 120, align: 'center' },
{ title: '内贸合同号', field: 'contractNo', key: 'contractNo', width: 120, align: 'center' },
{
  title: '外贸合同号',
  field: 'foreignContractNo',
  key: 'foreignContractNo',
  width: 120,

  align: 'center',
},
{ title: '供应商', field: 'supplier', key: 'supplier', width: 120, align: 'center' },
{
  title: '合同金额',
  field: 'contractAmount',

  key: 'contractAmount',
  align: 'center',
  width: 120,
},
{
  title: '报关金额',
  field: 'decAmount',

  key: 'decAmount',
  align: 'center',
  width: 120,
},
{
  title: '报关币制',
  field: 'decCurrency',

  key: 'decCurrency',
  align: 'center',
  width: 120,
},
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
